using BlazorAdmin.Models;
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BlazorAdmin.Interface
{
    /// <summary>
    /// Organize 接口
    /// </summary>
    public interface IOrganize
    {
        /// <summary>
        /// 保存、更新
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns>错误消息</returns>
        Task<string> Save(Organize entity);

        /// <summary>
        /// 递归删除组织
        /// </summary>
        /// <param name="orgCode">组织代码</param>
        /// <returns>错误消息</returns>
        Task<string> Delete(string orgCode);

        Task<List<TreeViewItem<Organize>>> GetOrganizeTree(string curUser, bool isChoose = false);
    }
}
